#include <opencv/cv.h>
#include <opencv/highgui.h>

using namespace cv;

void show_ipl_image (Mat &img)
{
	IplImage ipl = IplImage (img);
	cvShowImage ("ipl", &ipl);
	cvWaitKey (-1);
}

int main(void)
{
	VideoCapture cap(0); // open the default camera

	if(!cap.isOpened())  // check if we succeeded
		return -1;
	
	Mat edges;
	
	for(;;)
	{
		Mat frame;
		cap >> frame; 
		show_ipl_image(frame);
	}

	return 0;
}